<html>
<head><meta charset="utf-8"><title>for-await loops · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html">for-await loops</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199521788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199521788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199521788">(Jun 02 2020 at 16:57)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="127859">@Taylor Cramer</span> or others -- I remember during some of our discussions about <code>for.await</code> loops (or whatever) that you raised the point that "iterating over a stream sequentially isn't normally what you want to do" (at least that's what I think you said). I was curious if I am remembering accurately. It seems like the "stream interface" kind of implies a certain amount of "sequential-ness". In any case, I was curious to get more info on what are the patterns by which streams are typically consumed, if not</p>
<div class="codehilite"><pre><span></span><code><span class="k">while</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stream</span><span class="p">.</span><span class="n">next</span><span class="p">().</span><span class="k">await</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="o">..</span><span class="p">.</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="199521983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199521983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199521983">(Jun 02 2020 at 16:58)</a>:</h4>
<p>I don't know how many notes we kept from that conversation, I think <span class="user-mention" data-user-id="256759">@boats</span> had started a <a href="https://boats.gitlab.io/blog/post/for-await-i/">blog post series</a> but I don't think there was a Part 2.</p>



<a name="199522207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199522207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nell Shamrell-Harrington <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199522207">(Jun 02 2020 at 17:00)</a>:</h4>
<p>I wasn't able to find a part 2 of that post</p>



<a name="199525933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199525933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199525933">(Jun 02 2020 at 17:30)</a>:</h4>
<blockquote>
<p>In any case, I was curious to get more info on what are the patterns by which streams are typically consumed, if not</p>
</blockquote>
<p>Yes, that one. Although as described in the other topic that doesn't work too well with falliable Streams since you can't error out early.<br>
I think in the application that I'm currently working on there are lots of "Stream-like" types that use that convention, but actually not a single plain <code>Stream&lt;T&gt;</code> itself.</p>
<p><strong>Edit:</strong> Ooops, seems like I didn't read the first half of the question correctly. Thought it was just about looking for confirmation whether this is the usage pattern.</p>



<a name="199527587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199527587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199527587">(Jun 02 2020 at 17:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Yes, it's frequently the case that you want to pipeline work when handling streaming values</p>



<a name="199527637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199527637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199527637">(Jun 02 2020 at 17:43)</a>:</h4>
<p>by which I mean, you have elements coming of the stream 1, 2, 3, ...</p>



<a name="199527657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199527657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199527657">(Jun 02 2020 at 17:43)</a>:</h4>
<p>and you want to do something expensive with each of them that involves further asynchronous work</p>



<a name="199527705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199527705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199527705">(Jun 02 2020 at 17:43)</a>:</h4>
<p>once you get element 2 you want to start working on it, even if you're not done with all the processing you'll do on element 1</p>



<a name="199527786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199527786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199527786">(Jun 02 2020 at 17:44)</a>:</h4>
<p>an obvious example would be, like, download all the pages from a website corresponding to a stream of URLs</p>



<a name="199527825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199527825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199527825">(Jun 02 2020 at 17:44)</a>:</h4>
<p>if you waited to download the previous page before you started downloading the next one, you're losing out on concurrency</p>



<a name="199527886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199527886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199527886">(Jun 02 2020 at 17:44)</a>:</h4>
<p>and you're adding a network round trip time to the cost of each element, where before there was only a single round trip</p>



<a name="199527966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199527966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199527966">(Jun 02 2020 at 17:45)</a>:</h4>
<p>If you don't want to do this work, then you <em>really</em> want the definition of Stream to be "attached" rather than "unattached", as "unattached" favors this kind of concurrency</p>



<a name="199528187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199528187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199528187">(Jun 02 2020 at 17:47)</a>:</h4>
<p><span class="user-mention" data-user-id="127859">@Taylor Cramer</span> You can still model the source with a Stream (or even a synchronous iterator), then spawn downloads, do rate limiting via either a channel or an async semaphore, and then combine things again. So you can build that approach out of primitives if you want.<br>
Or as you already know - use a tool like <code>FuturesUnordered</code> which does all of it.</p>



<a name="199528271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199528271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199528271">(Jun 02 2020 at 17:48)</a>:</h4>
<p>From some work I've done on <a href="https://docs.rs/parallel-stream/2.1.1/parallel_stream/">parallel-stream</a> it seems one of the trickier things here is to configure limits. Assuming we would have syntax along the lines of <code>for x.await in y</code> this would imply a default concurrency setting: which means either we default to <code>1</code> (sequential), Infinity (unbounded), or some number in between.</p>
<p>Choosing a random number seems like it would rarely be the right choice. And making async iteration unbounded means it effectively operates without backpressure (risking OOM/fd exhaustion errors). I think having an upper concurrency limit of 1 (sequential) would be the most sensible default even if people may often want to parallelize streams instead.</p>



<a name="199528989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199528989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199528989">(Jun 02 2020 at 17:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="127859">Taylor Cramer</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/for-await.20loops/near/199527966">said</a>:</p>
<blockquote>
<p>If you don't want to do this work, then you <em>really</em> want the definition of Stream to be "attached" rather than "unattached", as "unattached" favors this kind of concurrency</p>
</blockquote>
<p>I was just going to say, this is depending on an "attached" stream. By the way, this terminology is not great. I've been thinking about whether we can use a term that is more about "ownership" - -i.e., the key point is that this <code>Stream</code> definition (like <code>Iterator</code>) is meant for a setup where the stream transfers ownership of each item as it is produced, versus retaining ownership. Maybe we can talk about it that way?</p>
<p>I am reminded then of <span class="user-mention" data-user-id="256759">@boats</span>'s post making the post that <code>AsyncRead</code> (and write) are a natural interface for cases where the "caller retains ownership of the buffer" (versus one, like <code>BufRead</code>, where the reader/writer owns the buffer)</p>



<a name="199529010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199529010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199529010">(Jun 02 2020 at 17:54)</a>:</h4>
<p><span class="user-mention" data-user-id="204219">@Matthias247</span> yes exactly, FuturesUnordered / .for_each_unordered is what you want</p>



<a name="199529032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199529032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199529032">(Jun 02 2020 at 17:54)</a>:</h4>
<p>not <code>while let Some(x) = stream.next().await</code></p>



<a name="199529102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199529102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199529102">(Jun 02 2020 at 17:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yes, it's exactly that case, where the stream itself owns the buffer</p>



<a name="199529350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199529350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199529350">(Jun 02 2020 at 17:56)</a>:</h4>
<p><span class="user-mention" data-user-id="204219">@Matthias247</span> <code>.buffered</code> is also helpful depending on what your goal is</p>



<a name="199529369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199529369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199529369">(Jun 02 2020 at 17:57)</a>:</h4>
<p>I'm not sure what's a good term that "gets at" this distinction. e.g., an "attached" or "streaming" stream is one that "retains" ownership -- maybe it's a "Retaining stream"? I don't know. The term "attached" was really meant to refer to the <em>output</em> of the stream -- that is, the items are "attached to" (owned by) the stream. (Or, conversely, the items are "detached from" the stream...)</p>



<a name="199529417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199529417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199529417">(Jun 02 2020 at 17:57)</a>:</h4>
<p>Right, that terminology made sense to me but I can see why it's imperfect.</p>



<a name="199529475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199529475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199529475">(Jun 02 2020 at 17:58)</a>:</h4>
<p>Similarly, I promise that if we keep the term "streaming iterator" it will be very confusing how that is not a stream...:)</p>



<a name="199529873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199529873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199529873">(Jun 02 2020 at 18:00)</a>:</h4>
<p>Yeah, I'm still thinking about terms like "free", "coupled"/"uncoupled" but those are basically just the same as "attached"</p>



<a name="199529900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199529900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199529900">(Jun 02 2020 at 18:01)</a>:</h4>
<p>"joined" is obviously problematic :)</p>



<a name="199530158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199530158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199530158">(Jun 02 2020 at 18:02)</a>:</h4>
<p>borrowing / owning? -- borrowed / owned?</p>



<a name="199530559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199530559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199530559">(Jun 02 2020 at 18:06)</a>:</h4>
<p>something like <code>RefStream</code> might solve the problem of "talking about the stream instead of its output"</p>



<a name="199530727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199530727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199530727">(Jun 02 2020 at 18:07)</a>:</h4>
<p>though it would still be nice to capture the fact that this is a generalization of <code>Stream</code>, and the output might not have a reference at all</p>



<a name="199530843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199530843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199530843">(Jun 02 2020 at 18:08)</a>:</h4>
<p><code>RefStream</code> sounds kind of like a stream of references</p>



<a name="199530887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199530887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199530887">(Jun 02 2020 at 18:08)</a>:</h4>
<p>I might be in the minority here, but I'd also prefer symmetric terminology (though that's probably not doable)</p>



<a name="199530930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199530930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199530930">(Jun 02 2020 at 18:09)</a>:</h4>
<p>so that when I'm speaking, it's clear when I say <code>Stream</code> that I <em>don't</em> mean a <code>RefStream</code> etc.</p>



<a name="199530955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199530955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199530955">(Jun 02 2020 at 18:09)</a>:</h4>
<p>I mean, that's sort of true in that the output contains a reference back to the stream</p>



<a name="199530982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199530982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199530982">(Jun 02 2020 at 18:09)</a>:</h4>
<p>Yes, conceptually that's not a terrible way to think about it</p>



<a name="199531087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199531087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199531087">(Jun 02 2020 at 18:10)</a>:</h4>
<p>I fully agree that symmetric terminology would be nice, but I'm not sure what we would do about <code>Iterator</code></p>



<a name="199531615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199531615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199531615">(Jun 02 2020 at 18:14)</a>:</h4>
<p>I don't know what "symmetric" terminology means</p>



<a name="199532465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199532465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199532465">(Jun 02 2020 at 18:20)</a>:</h4>
<p>I don't know what problem you guys are trying to solve here <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span></p>
<p>If this is a special use-case, give it a special name?</p>



<a name="199562574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/for-await%20loops/near/199562574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/for-await.20loops.html#199562574">(Jun 02 2020 at 22:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/for-await.20loops/near/199531615">said</a>:</p>
<blockquote>
<p>I don't know what "symmetric" terminology means</p>
</blockquote>
<p>a (not very good) example would be to have both <code>AttachedStream</code> and <code>UnattachedStream</code>, instead of having a regular <code>Stream</code> name at all</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>